VyOS Operation Notes
Table of Contents
VyOS Basics #
Notes on everyday VyOS operations, focusing on the most commonly used commands.
Two CLI Modes #
| Prompt | Mode | Purpose |
|---|---|---|
| $ | Operational Mode | Linux OS operations and configuration display |
| # | Configuration Mode | Apply, modify, and save configuration |
Switching Modes #
| Transition | Command | Result |
|---|---|---|
| Operational β Configuration | configure | Prompt changes to # |
| Configuration β Operational | exit | Prompt changes to $ |
Key Operational Mode Commands #
| Command | Action | Notes |
|---|---|---|
| show configuration | Display configuration | Tree format |
| show configuration commands | Display configuration | Command-line format |
| show version | Show version info | VyOS version, hardware, etc. |
| show XXX | Show other status | Use show [TAB] to list subcommands |
| reboot | Reboot | |
| configure | Enter Configuration Mode | Prompt changes to # |
Configuration Mode Command Basics #
| Command | Action | Notes |
|---|---|---|
| set XXX | Modify configuration | Changes are staged (pending) |
| delete XXX | Delete specific configuration | Changes are staged (pending) |
| show XXXX | Display configuration | Includes pending changes |
| commit | Apply changes | Applies all staged changes |
| save | Save | Saves to startup configuration |
| run XXXXX | Run operational command XXXX | Executes without leaving config mode Example: run show configuration commands |
| rollback N | Roll back N commits | N=0 or more Use run show system commit to list commit numbers |
| exit | Return to Operational Mode | Prompt changes to $ |
VyOS Upgrade #
Rolling Release upgrade procedure β run in Operational Mode.
Pre-Update Check #
Check the current VyOS version.
show version
Version: VyOS 1.4-rolling-202302080317
Release train: current
Built by: [email protected]
Built on: Wed 08 Feb 2023 03:17 UTC
Build UUID: ce4d9361-2f83-44a1-88f4-488f1aa20f02
Build commit ID: 8cade9112a16ed
Architecture: x86_64
Boot via: installed image
System type: VMware guest
Hardware vendor: VMware, Inc.
Hardware model: VMware Virtual Platform
Hardware S/N: VMware-42 04 e6 47 10 ac 81 be-db c7 bc e8 e2 87 ba 2b
Hardware UUID: 47e60442-ac10-be81-dbc7-bce8e287ba2b
Copyright: VyOS maintainers and contributors
Check the current installed image version.
show system image
The system currently has the following image(s) installed:
1: 1.4-rolling-202302080317 (default boot) (running image)
Check the VyOS nightly builds page to see if a new release is available. Copy the URL of the latest ISO file and paste it into the command below. Press [Enter] for all prompts.
add system image https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.X-rolling-YYYYMMDDnnnn/vyos-1.X-rolling-YYYYMMDDnnnn-amd64.iso
Trying to fetch ISO file from https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.X-rolling-YYYYMMDDnnnn/vyos-1.X-rolling-YYYYMMDDnnnn-amd64.iso...
Downloading...
The file is 434.000 MiB.
[############################################################################################################] 100%
Download complete.
Done.
Checking for digital signature file...
Downloading...
(abbreviated)
Do you want to continue without signature check? (yes/no) [yes]
Checking SHA256 checksums of files on the ISO image... OK.
Done!
What would you like to name this image? [1.X-rolling-YYYYMMDDnnnn]:
OK. This image will be named: 1.X-rolling-YYYYMMDDnnnn
Installing "1.X-rolling-YYYYMMDDnnnn" image.
Copying new release files...
Would you like to save the current configuration
directory and config file? (Yes/No) [Yes]:
Copying current configuration...
Would you like to save the SSH host keys from your
current configuration? (Yes/No) [Yes]:
Copying SSH keys...
Running post-install script...
Setting up grub configuration...
Done.
Verify that the downloaded image is ready.
show system image
The system currently has the following image(s) installed:
1: 1.4-rolling-202302110748 (default boot)
2: 1.4-rolling-202302080317 (running image)
Reboot.
$ reboot
Are you sure you want to reboot this system? [y/N] y
Reconnect via SSH after the reboot completes.
Verify the VyOS version and image state after boot.
vyos@gd4rt01:~$ show version
Version: VyOS 1.4-rolling-202302110748
Release train: current
Built by: [email protected]
Built on: Sat 11 Feb 2023 07:48 UTC
Build UUID: f3c3ece9-fd81-44a7-835e-ddf75a0c11f9
Build commit ID: 6d90ea4912b158
Architecture: x86_64
Boot via: installed image
System type: VMware guest
Hardware vendor: VMware, Inc.
Hardware model: VMware Virtual Platform
Hardware S/N: VMware-42 04 e6 47 10 ac 81 be-db c7 bc e8 e2 87 ba 2b
Hardware UUID: 47e60442-ac10-be81-dbc7-bce8e287ba2b
Copyright: VyOS maintainers and contributors
Post-Update Check #
If IPsec connections are defined, verify they have recovered after the update.
show vpn ipsec sa
Remove Old Version #
Once operation is confirmed, delete the old image. Specify the unused image name shown by show system image.
vyos@gd4rt01:~$ delete system image 1.4-rolling-202302080317
Are you sure you want to delete the
"1.4-rolling-202302080317" image? (Yes/No) [No]: Yes
Deleting the "1.4-rolling-202302080317" image...
Done
Confirm deletion is complete with the image list.
vyos@gd4rt01:~$ show system image
The system currently has the following image(s) installed:
1: 1.4-rolling-202302110748 (default boot) (running image)
References #
Official documentation: